package com.xcdh.commons.exception;

import com.xcdh.consts.StateCode;
import com.xcdh.domain.vo.R;
import org.springframework.boot.web.servlet.error.ErrorController;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class CustomErrorHandler implements ErrorController {

    @RequestMapping("/error")
    public R handleError() {
        // 返回自定义的错误页面或错误信息
        return R.error(StateCode.NOT_SOURCE , "找不到资源");
    }

}
